<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" ></meta>
    <link rel="stylesheet" type="text/css" th:href="@{/common/css/login.css}">
</head>
<script th:inline="javascript" type="text/javascript">
	function loginSubmit() {
		var _kname = document.getElementsByName("name")[0].value;
	    var _kpassword = document.getElementsByName("password")[0].value;
		if(_kname&&_kpassword)
		document.getElementById("loginForm").submit();
	}
	function reset() {
		document.getElementById("loginForm").reset();
		document.getElementById("errortips").innerHTML='';
	}
	function keyLogin() {
		var heigh = document.body.offsetHeight;
		document.onkeydown = function mykeyDown(e) {
			e = e || event;
			if (e.keyCode == 13) {//回车键的键值为13  
				var _kname = document.getElementsByName("name")[0].value;
			    var _kpassword = document.getElementsByName("password")[0].value;
				if(_kname&&_kpassword)
					document.getElementById("login_btn_id").click(); //调用登录按钮的登录事件  
			}
			return;
		}
	}
</script>
<body onkeydown="keyLogin();">
	<div class="div_body">
		<div class="login_area">
			<form th:action="@{/login/dologin}" method="post" id="loginForm">
				<div class="login_text">
					<div class="login_name">
						<div class="name_text">用户名</div>
						<div class="name_area"><input name="name"type="text"  class="text_input" value="sys"></div>
					</div>
					<div class="login_password">
						<div class="password_text">密码</div>
						<div class="password_area"><input name="password" type="password"  class="text_input" value="123456"></div>
					</div>
				</div>
			</form>
			<div class="login_btnarea">
				<div id="login_btn_id" class="login_btn" onClick="loginSubmit();"><a href="#">登录</a></div>
				<div class="login_btna" onClick="reset();"><a href="#">重置</a></div>
			</div>
		</div>
	</div>
</body>